using System;
using System.Collections.Generic;
using System.Linq;

namespace DIS_WEB_Client.Repositories
{
	#region using
	using DIS_WEB_Client.Helpers;
    using DIS_Web_Client.DIS_WS_BusinessLayer;
	#endregion
	public class OrderDetailRepository
	{
        public bool DeleteByOrder(int idoder)
        {
            try
            {
                return BusService.Instance.OrderDetail_DeleteByOrder(idoder);
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    GlobalVariables.Logger.Error(ex.InnerException.Message);
                }
                else
                {
                    GlobalVariables.Logger.Error(ex.Message);
                }
            }
            return false;
        }

        public List<OrderDetailDTO> SelectByIDOrder(int idorder)
        {
            try
            {
                return BusService.Instance.OrderDetail_SelectByIDOrder(idorder).ToList();
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    GlobalVariables.Logger.Error(ex.InnerException.Message);
                }
                else
                {
                    GlobalVariables.Logger.Error(ex.Message);
                }
            }
            return new List<OrderDetailDTO>();
        }
	}
}